<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script th:src="@{/js/jquery-3.3.1.min.js}"></script>
</head>
<script>
    function getLogList(){
        var tk = $('#tk').val();
        var dataSrc = {
            "pageNo": $('#userName').val(),
            "pageSize": $('#password').val()
        };
        $.ajax({
            contentType:"application/json",
            type : "post",    //请求类型
            traditional:true,
            url : "[[@{/log/getLogList}]]",//请求的 URL地址
            dataType : "JSON",//返回的数据类型
            data:JSON.stringify(dataSrc),
            headers: {'Authorization': tk},
            success: function (data) {
                $('#ret').html(JSON.stringify(data));
            },
            error:function (data) {
                $('#ret').html(JSON.stringify(data));
            }
        });
    }
    function getcookie(objname){//获取指定名称的cookie的值
        var arrstr = document.cookie.split("; ");
        for(var i = 0;i < arrstr.length;i ++){
            var temp = arrstr[i].split("=");
            if(temp[0] == objname) return unescape(temp[1]);
        }
    }
</script>
<body>
<div><input id="tk"></div>
   <button onclick="getLogList()">获取日志列表</button>
<div id="ret"></div>
</body>
</html>